import time

from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop021"
brand_name = '苹果'
testCase = "DBshop021"
firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','商品品牌')
#点击删除
firefox.find_element_by_xpath('//td[contains(text(),"%s")]/following-sibling::td[4]/a[2]'%brand_name).click()
firefox.switch_to.alert.accept()
time.sleep(8)

try:
    firefox.find_element_by_xpath('//td[contains(text(),"%s")]'%brand_name)
    writeLog("%s 测试失败"%testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过"%testCase)
